<!--
 * @Author: your name
 * @Date: 2021-08-23 16:14:19
 * @LastEditTime: 2021-10-02 21:40:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ewshop\ewshop\src\App.vue
-->
<template>
<!-- <router-view/> -->

<!-- vue3.0配置 -->
  <router-view v-slot="{ Component }">
    <transition>
      <keep-alive exclude="Detail">
        <component :is="Component" />
      </keep-alive>
    </transition>
  </router-view>

  <div id="nav">
    <router-link class="tab-bar-item" to="/">
      <div class="icon"><i class="iconfont icon-1"></i></div>
      <div>首页</div>
    </router-link>
    <router-link class="tab-bar-item" to="/Categroy">
      <div class="icon"><i class="iconfont icon-fenlei"></i></div>
      <div>分类</div>
    </router-link>
    <router-link class="tab-bar-item" to="/shopcart">
      <div class="icon">
        <van-badge :content="$store.state.cartCount?$store.state.cartCount:0" max="9">
          <i class="iconfont icon-xiazai1"></i>
        </van-badge>
      </div>
      <div>购物车</div>
      
      
    </router-link>
    <router-link class="tab-bar-item" to="/profile">
      <div class="icon"><i class="iconfont icon-04"></i></div>
      <div>我的</div>
    </router-link>
  
  </div>
  
</template>

<style lang="scss">
@import "assets/css/base.css";
@import "assets/css/iconfont.css";
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  background-color: #F6F6F6;
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  box-shadow: 0 -3px 1px rgba(100,100,100, 0.1);
  a {
    color: var(--color-text);

    &.router-link-exact-active {
      color: #42b983;
    }
  }
  .tab-bar-item{
    flex: 1;
    text-align: center;
    height: 50px;
    font-size: var(--font-size);
  }
  .tab-bar-item .icon{
    width: 24px;
    height: 24px;
    margin-top: 5px;
    // vertical-align: middle;
    display: inline-block;
  }
}
</style>
